home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / networking / amitcp / amislate1.0.lha / AmiSlate1.0 / SlateRexx / qix.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1995-03-13  |  1.6 KB  |  95 lines

  1. /* An Arexx script for use with AmiSlate:  
  2.  
  3.    Does the cool Qix/bouncing line/screenblanker thingy  :)
  4.    
  5. */
  6. parse arg CommandPort ActiveString
  7.  
  8. address (CommandPort)
  9. options results
  10.  
  11. x=15
  12. y=15
  13. dx=0
  14. dy=0
  15. nsteps = 1000
  16. nscale = 16/1000
  17.  
  18. /* Draw a black box around the window border */
  19. setfcolor 0 0 0
  20. GetWindowAttrs stem win.
  21.  
  22.  
  23. /* Note that GetWindowAttrs returns the size of the whole window including
  24.    the ToolBar, Palette, Chat Lines, Title, and everything else.  To just
  25.    draw to the border of the drawing area, we need to subtract the constants
  26.    below.  */
  27.  
  28. square 0 0 (win.width - 58) (win.height - 53)
  29.  
  30.  
  31. MinX = 1
  32. MinY = 1
  33. MaxX = win.width - 59
  34. MaxY = win.height - 54
  35.  
  36. speed = 5
  37. x1 = Rand(MaxX-MinX)+MinX 
  38. y1 = Rand(MaxY-MinY)+MinX
  39. x2 = Rand(MaxX-MinX)+MinX 
  40. y2 = Rand(MaxY-MinY)+MinX
  41.  
  42. x1d = Rand(speed*2) - trunc(speed/2)
  43. y1d = Rand(speed*2) - trunc(speed/2)
  44. x2d = Rand(speed*2) - trunc(speed/2)
  45. y2d = Rand(speed*2) - trunc(speed/2)
  46.  
  47. do while (1)
  48.     line x1 y1 x2 y2 XOR
  49.     xx = delay(1)
  50.     line x1 y1 x2 y2 XOR
  51.  
  52.     x1 = x1 + x1d
  53.     x2 = x2 + x2d
  54.     y1 = y1 + y1d
  55.     y2 = y2 + y2d
  56.     
  57.     if (x1 > MaxX) then do
  58.         x1 = MaxX
  59.         x1d = -Rand(speed)
  60.         end
  61.     if (x2 > MaxX) then do
  62.         x2 = MaxX
  63.         x2d = -Rand(speed)
  64.         end
  65.  
  66.     if (x1 < MinX) then do
  67.         x1 = MinX
  68.         x1d = Rand(speed)
  69.         end
  70.     if (x2 < MinX) then do
  71.         x2 = MinX
  72.         x2d = Rand(speed)
  73.         end
  74.  
  75.     if (y1 > MaxY) then do
  76.         y1 = MaxY
  77.         y1d = -Rand(speed)
  78.         end
  79.     if (y2 > MaxY) then do
  80.         y2 = MaxY
  81.         y2d = -Rand(speed)
  82.         end
  83.  
  84.     if (y1 < MinY) then do
  85.         y1 = MinY
  86.         y1d = Rand(speed)
  87.         end
  88.     if (y2 < MinY) then do
  89.         y2 = MinY
  90.         y2d = Rand(speed)
  91.         end
  92. end
  93.  
  94. rand:
  95.     return trunc(Random()*arg(1)/1000)